package j02yichang;

public class J1 {
    public static void main(String[] args) {
//        System.out.println(10/0);
//        f1();
    }
    static void f1(){
//        int a = 4;
//        f1();
//        System.out.println("end");
    }
}

class Cat{
    int age;
}
class J2yunxingshi{
    public static void main(String[] args) {
//        int[] arr = {1,2};
//        System.out.println(arr[1000]);
//        Cat cat = new Cat();
//        cat=null;
//        System.out.println(cat.age);

//        try {
//            //算术异常,ArithmeticException
//            System.out.println(10/0);
//        }catch (Exception e){
//            System.out.println(e);
//        }
        try {
            //算术异常,ArithmeticException
            System.out.println(10/0);
        }catch (ArithmeticException e){
//            System.out.println(e);
            //打印出详细的错误信息，第几行
            e.printStackTrace();
        }

        try {
            int arr[] = {1,2};
            System.out.println(arr[1000]);
        }catch (Exception e){
            e.printStackTrace();
        }
        System.out.println("end");
    }
}